<include file="public@header" />
<script type="text/html" id="photos-item-tpl">
    <li id="saved-image{id}">
        <input id="photo-{id}" type="hidden" name="images[]" value="{filepath}">
        <img id="photo-{id}-preview" src="{url}" style="height:50px;width: 50px;margin: 10px;"
             onclick="imagePreviewDialog(this.src);">
        <a href="javascript:uploadOneImage('图片上传','#photo-{id}');">替换</a>
        <a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>
    </li>
</script>
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li><a href="{:url('project/index')}">项目列表</a></li>
			<li class="active"><a href="{:url('project/add')}">项目添加</a></li>
		</ul>
		<form method="post" class="form-horizontal js-ajax-form margin-top-20" action="{:url('project/add')}">
			<div class="form-group">
				<label class="col-sm-2 control-label"><span class="form-required">*</span>项目名称</label>
				<div class="col-md-6 col-sm-10">
					<input type="text" class="form-control" name="title">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label"><span class="form-required">*</span>组图</label>
				<div class="col-md-6 col-sm-10">
                    <ul id="photos" class="pic-list list-unstyled form-inline"></ul>
                    <a href="javascript:uploadMultiImage('图片上传','#photos','photos-item-tpl');" class="btn btn-default btn-sm">选择图片</a>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label"><span class="form-required">*</span>归属门店</label>
				<div class="col-md-6 col-sm-10">
					<select class="form-control" name="store_id">
		            	<option value="">---请选择门店---</option>
		            	<foreach name="store_list" item="vo">
		            		<option value="{$vo.id}">{$vo.name}</option>
		            	</foreach>
		            </select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label"><span class="form-required">*</span>项目类型</label>
				<div class="col-md-6 col-sm-10">
					<select class="form-control" name="type_id">
		            	<option value="">---请选择类型---</option>
		            	<foreach name="type_list" item="vo">
		            		<option value="{$vo.id}">{$vo.title}</option>
		            	</foreach>
		            </select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label"><span class="form-required">*</span>项目价格</label>
				<div class="col-md-6 col-sm-10">
					<input type="text" class="form-control" name="price">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label"><span class="form-required">*</span>使用须知</label>
				<div class="col-md-6 col-sm-10">
					<textarea type="text" class="form-control" name="instructions" style="height:120px;"></textarea>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label"><span class="form-required">*</span>详情</label>
				<div class="col-md-6 col-sm-10">
					<textarea type="text" class="form-control" name="detail" style="height:200px;"></textarea>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label"><span class="form-required">*</span>状态</label>
				<div class="col-md-6 col-sm-10">
					<select class="form-control" name="status">
		            	<option value="1">上架</option>
		            	<option value="0">下架</option>
		            </select>
				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-offset-2 col-sm-10">
					<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('ADD')}</button>
				</div>
			</div>
		</form>
	</div>
	<script src="__STATIC__/js/admin.js"></script>
</body>
</html>